package com.itheima.array;

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        int[] arr = {-12,-45,-98,-73,-60};
        /*for (int i = 0; i < arr.length; i++) {
            if(arr[i] < min){
                min = arr[i];
            }
        }
        System.out.println(min);*/

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您要查找的元素:");
        int sum = sc.nextInt();

        int index = -1;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == sum){
                index = i;
            }

        }
        System.out.println("index = " + index);
    }
}

